package com.james.jni_base;

import android.util.Log;

public class JavaTest {
    int number = 7;
    String content = "This is Java";

    public JavaTest() {
        System.loadLibrary("native-lib");
    }


    /**
     * A native method that is implemented by the 'native-lib' native library,
     * which is packaged with this application.
     */
    public native String stringFromJNI();

    public static native void initIds();

    public static void exceptionCallback() {
        int a = 20 / 0;
        System.out.println("--->" + a);
    }

    public static void normalCallback() {
        System.out.println("In Java: invoke normalCallback.");
    }


    public static void cDiao(String message) {
        Log.i("cDiao = ", message);
    }


    public void cNewObjDJ() {
        Log.i("cNewObjDJ", "c 通过jobject 对象调用java 方法");
    }

    public native byte[] returnByteArray();

    public native String MainopteratString(String str, String[] arrays);

    public native void CCallJavaStatic();

    public native void CDiaoJavaByOject();

    public native void changeValue();

    public native void dynamicJavaTests(String text);

    public native void dynamicJavaStringTest();


    public static void fromJNI(int i) {
        Log.i("from jni i=", i + "");
    }


    public native void doit();


    public native void setJNIEnv();

    public native void mainThread();
}
